<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        function f1() {

        }
        function f2() {
            return 123
        }
        // async修饰的函数返回值自动会变为promise
        async function f3() {
            return 123
        }

        // async修饰的函数返回值自动会变为promise
        async function f4() {
        }
        function init() {
            const res1 = f1()
            const res2 = f2()
            const res3 = f3()
            const res4 = f4()

            console.log('res1  ----->  ', res1); //函数没有return则返回undefined
            console.log('res2  ----->  ', res2); //函数返回return 的值
            console.log('res3  ----->  ', res3); //async修饰的函数和返回Promise对象
            console.log('res4  ----->  ', res4); //async修饰的函数和返回Promise对象
        }

        init()
    </script>
</body>

</html>